<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>
  {
    // 写一个 repeat 方法，实现字符串的复制拼接
    function repeat(target,n){
      return (new Array(n + 1)).join(target)
    }

    console.log(repeat('love',520))
  }
  {
    function repeat(target,n){
      return Array.from({length:n},()=>target).join('')
    }

    console.log(repeat('婷',5))
  }
</script>
</html>